package com.testplatfrom.project.controller;


import com.testplatfrom.common.core.domain.R;
import com.testplatfrom.common.security.annotation.RequiresPermissions;
import com.testplatfrom.project.domain.TestplatfromDatabase;
import com.testplatfrom.project.domain.dto.project.TestplatfromProjectPage;
import com.testplatfrom.project.domain.dto.project.TestplatfromProjectPageVo;
import com.testplatfrom.project.service.TestplatfromDatabaseService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 环境数据库链接配置 前端控制器
 * </p>
 *
 * @author 杨森
 * @since 2023-08-14
 */
@RestController
@RequestMapping("/testplatfromDatabase")
public class TestplatfromDatabaseController {

    @Autowired
    private TestplatfromDatabaseService testplatfromDatabaseService;

    /**
     * 测试数据库连接
     */
    @ApiOperation(value = "测试数据库连接", notes = "测试数据库连接")
    @PostMapping("/test")
    public R<Boolean> list(@Valid @RequestBody TestplatfromDatabase testplatfromDatabase) throws ClassNotFoundException {
        return R.ok(testplatfromDatabaseService.databaseConnection(testplatfromDatabase));
    }

}

